{% extends 'forum/index.html' %}
{#{% load staticfiles %}#}
{% block l_content %}
    <style>
        .bq_1 {
            margin-left: 2%;
            background-color: deepskyblue;
            font-size: 1.5rem;
            border-radius: 3px;
            padding: 3px;
            color: white
        }

        .bq_2 {
            margin-left: 2%;
            background-color: cornflowerblue;
            font-size: 1.5rem;
            border-radius: 3px;
            padding: 3px;
            color: white
        }
    </style>
    <div id="search">
        <form class="form-horizontal" role="form" action="/forum/me/?tag=0" method="get">
            <div style="position: absolute;right: 15px;z-index: 1">
                <button type="submit" class="btn btn-primary">搜索</button>
            </div>
            <div class="col-sm-12">
                {% if text %}
                    <input type="text" name="text" class="form-control" id="firstname" placeholder="输入搜索内容"
                           value="{{ text }}">
                {% else %}
                    <input type="text" name="text" class="form-control" id="firstname" placeholder="输入搜索内容">
                {% endif %}
            </div>
        </form>
        <div class="col-sm-12">
            <p style="font-size: 2rem;margin-top: 5%;color: dodgerblue">分类列表</p>
            <a href="/forum/me/?tag=-1&text={{ text }}">
                <p class="fenlei"><span class="label label-info">点赞最多</span></p></a>
            <a href="/forum/me/?tag=0&text={{ text }}">
                <p class="fenlei"><span class="label label-info">全部</span></p></a>
            <a href="/forum/me/?tag=-2&text={{ text }}">
                <p class="fenlei"><span class="label label-info">只看发布</span></p></a>
            <a href="/forum/me/?tag=0&text={{ text }}">
                <a href="/forum/me/?tag=-3&text={{ text }}">
                    <p class="fenlei"><span class="label label-info">只看评论</span></p></a>
                <a href="/forum/me/?tag=0&text={{ text }}">
                    {% for o in tags %}
                        {% if o.id == tag %}
                            <a href="/forum/me/?tag={{ o.id }}&text={{ text }}">
                                <p class="fenlei"><span class="label label-success">{{ o.type }}</span></p></a>
                        {% else %}
                            <a href="/forum/me/?tag={{ o.id }}&text={{ text }}">
                                <p class="fenlei"><span class="label label-default">{{ o.type }}</span></p></a>
                        {% endif %}
                    {% endfor %}
        </div>
    </div>
    {% for o in article %}
        <div class="f_one">
            <div>
                <p class="bt"><a href="/forum/article_deatil/?id={{ o.id }}&type=1" class="black">{{ o.title }}</a>
                    <span class="bq_1">我发布的</span>
                </p>

                <p class="auther">
                    <span>{{ o.auther }}({{ o.depart }})</span><span
                        class="margin_left">{{ o.time }}</span><span class="margin_left">{{ o.tag }}</span>
                </p>
                <a href="/forum/article_deatil/?id={{ o.id }}&type=1" class="black"><p class="theme">

                    {{ o.content|safe }}


                </p></a>
                <p class="wei">
                    {% if is_coll %}
                        <span class="pl allready" disabled="true" style="background-color: orange">已收藏</span>
                    {% else %}
                        <span class="pl" style="background-color: orange">收藏{{ o.coll }}</span>
                    {% endif %}
                    <a href="/forum/article_deatil/?id={{ o.id }}&type=1">
                        <span class="margin_left pl">讨论{{ o.pl_num }}</span></a>
                    {% if is_praise %}
                        <span class="margin_left zan allready" disabled="true">已赞{{ o.praise }}</span>
                    {% else %}
                        <span class="margin_left zan">点赞{{ o.praise }}</span>
                    {% endif %}
                    <span class="margin_left pl">转发</span>
                </p>
            </div>
            {% if o.dp %}
                <div class="nice-pinglun">
                    <p>
                        <span style="color: orangered">经典评论</span><span style="color: blue"
                                                                        class="pl">{{ o.dp.user }}({{ o.dp.depart }})</span>:
                        <span style="color: grey;opacity: 0.5">下面是点赞最多的评论哦</span>
                        <br>
                        <span>{{ o.dp.content }}</span><span class="zan margin_left">赞{{ o.dp.praise }}</span>
                    </p>
                </div>
            {% endif %}
        </div>
    {% endfor %}
    {% for o in pl %}
        <div class="f_one">
            <div>
                <p class="bt"><a href="#" class="black">{{ o.title }}</a>
                    <span class="bq_2">我评论的</span></p>
                <p class="auther">
                    <span>{{ o.auther }}({{ o.depart }})</span><span
                        class="margin_left">{{ o.time }}</span><span class="margin_left">{{ o.tag }}</span>
                </p>
                <a href="#" class="black"><p class="theme">
                    {{ o.content|safe }}
                </p></a>
                <p class="wei">
                    {% if is_coll %}
                        <span class="pl allready" disabled="true" style="background-color: orange">已收藏</span>
                    {% else %}
                        <span class="pl" style="background-color: orange">收藏{{ o.coll }}</span>
                    {% endif %}
                    <span class="margin_left pl">讨论{{ o.pl_num }}</span>
                    {% if is_praise %}
                        <span class="margin_left zan allready" disabled="true">已赞{{ o.praise }}</span>
                    {% else %}
                        <span class="margin_left zan">点赞{{ o.praise }}</span>
                    {% endif %}
                    <span class="margin_left pl">转发</span>
                </p>
            </div>
            {% if o.dp %}
                <div class="nice-pinglun">
                    <p>
                        <span style="color: orangered">经典评论</span><span style="color: blue"
                                                                        class="pl">{{ o.dp.user }}({{ o.dp.depart }})</span>:
                        <span style="color: grey;opacity: 0.5">下面是点赞最多的评论哦</span>
                        <br>
                        <span>{{ o.dp.content }}</span><span class="zan margin_left">赞{{ o.dp.praise }}</span>
                    </p>
                </div>
            {% endif %}
        </div>
    {% endfor %}
    <script>
        $('.l_li').removeClass('active');
        $('#3').addClass('active');
    </script>
{% endblock %}